.chat-header {
  height: 60px;
  display: flex;
  align-items: center;
  background: transparent;
  padding: 0 20px;
}
.back-icon {
  width: 36px;
  height: 36px;
  cursor: pointer;
}
.chat-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #282a2e;
}

.chat-list {
  flex: 1;
  display: flex;
  flex-direction: column; // 垂直排列
  padding: 12px 14px 90px;
  overflow-y: auto;
  scroll-behavior: smooth;
}


.chat-msg {
  display: inline-flex; // 自动包裹文字大小
  align-items: center;
  max-width: 75%; // 限制最大宽度
  margin: 8px 0;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 24px;
  line-height: 1.6;
  word-break: break-word;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  animation: fadeIn 0.25s;
}


.chat-msg.user {
  align-self: flex-end;
  background: #236bff;
  color: #fff;
}

.chat-msg.bot {
  align-self: flex-start;
  background: #383f49;
  color: #fff;
}

.chat-msg.user::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 14px;
  border-width: 6px 0 6px 8px;
  border-style: solid;
  border-color: transparent transparent transparent #236bff;
}

.chat-msg.bot::after {
  content: "";
  position: absolute;
  left: -8px;
  top: 14px;
  border-width: 6px 8px 6px 0;
  border-style: solid;
  border-color: transparent #383f49 transparent transparent;
}


.chat-input-bar {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  background: #282a2e;
  border-top: 1px solid #383f49;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  gap: 8px;
}

.chat-input {
  flex: 1;
  min-height: 40px;
  border: 1px solid #383f49;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 24px;
  background: rgba(161, 169, 186, 0.1);
  outline: none;
  color: #fff;
}

.chat-send {
  width: 122px;
  background: #236bff;
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 24px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.chat-send:disabled {
  background: #a3c4ff;
  cursor: not-allowed;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}


.chat-msg.bot.loading {
  display: flex;
  align-items: center;
}

.dot-loading {
  display: flex;
  gap: 4px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #999;
  animation: blink 1.2s infinite ease-in-out;
}

.dot:nth-child(2) {
  animation-delay: 0.2s;
}
.dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%, 80%, 100% {
    opacity: 0.2;
  }
  40% {
    opacity: 1;
  }
}
